home *** CD-ROM | disk | FTP | other *** search
Wrap
/*----------------------------------------------------------------------------*\ * * DDDDDD WW WW TTTTTTTT IIIIIIII (C)Copyright 1996 * DD DD WW WW TTTTTTTT II Dataware Technologies, Inc. * DD DD WW WW WW TT II Boulder, Colorado * DD DD WWW WWW TT II * DDDDDD W W TT IIIIIIII * * * This installation program uses InstallShield(R) 3 and installs * Linear Technlogy's LinearView Application * * * File Name: LINEAR.RUL * * Description: Linear Technology * 16-bit script. * * * Author: Raymond Bridge 6/23/96, et seq. * revised Raymond Bridge 7/6/96, 7/9/96 * * Comments: * * * * * * * * \*----------------------------------------------------------------------------*/ declare #include "sddialog.h" // Constant declarations. #define APP_NAME "LinearView" #define UNINSTALL_NAME "LinearView" #define PROGRAM_FOLDER_NAME "Linear Technology" #define APPBASE_PATH "Linear" #define COMPANY_NAME "Linear Technology" #define PRODUCT_NAME "LinearView" #define PRODUCT_VERSION "1.0" #define DEINSTALL_KEY "LinearDeinstKey" #define PRODUCT_KEY "linear.exe" // Global variable declarations. STRING svFolder, svDir, szMsg, szFileSet, szTitle, szComponents, svComponent, svUninstLogFile, szIniFile, szSection, szLine, svInstalledFile, svDummyResult, svGroupPath; STRING svTarget[ 255 ], szDrive, szPath[255], szProgram, szTemp[ 255 ], szOLE; BOOL bSpaceOk; BOOL bLinear; //Flag currently used to determine whether to install main program files BOOL bAcrobat; //Flag currently used to determine whether run Acrobat setup BOOL bSwitcher; //Flag currently used to determine whether run SwitcherCAD install BOOL bFilter; //Flag currently used to determine whether to run FilterCAD install BOOL bSpice; //Flag currently used to determine whether to run Spice install BOOL bNoise; //Flag currently used to determine whether to run Noise install NUMBER lResult, nResult, nvItemCount; NUMBER nvResult; // Result from system information call STRING svResult; // Result from system information call NUMBER nOS; // Operating system STRING sOS; // Operating system string representation NUMBER nWinMajor; // Windows major version number NUMBER nWinMinor; // Windows minor version number STRING sWinMajor; // Windows major version number STRING sWinMinor; // Windows minor version number NUMBER nOSMajor; // OS major version number NUMBER nOSMinor; // OS minor version number NUMBER nvFileHandle; NUMBER nvSize, nFreeSpace, nSpaceRequired; /* For disk space checking */ NUMBER nFileCount, nSize, nDone; // Computing progress LIST listSpace; /* For totalling disk space */ LIST listInfo; /* Information dialogs contents */ // Function declarations. prototype SetupScreen(); prototype CheckRequirements(); prototype Ole2Dll(); program StartHere: Disable( BACKGROUND ); // Set installation info., which is required for registry entries. InstallationInfo( COMPANY_NAME, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY ); // Set up the installation screen. SetupScreen(); Enable( DIALOGCACHE ); CheckRequirements(); /* Just does screen at the moment. */ // Create a Welcome dialog. WelcomeDlg: Disable( BACKBUTTON ); Welcome( "", 0 ); Enable( BACKBUTTON ); IntroDlg: listInfo = ListCreate(STRINGLIST); szTitle = "LinearView Installation"; ListAddString(listInfo,"LinearView is Linear Technology Corporation's electronic publication",AFTER); ListAddString(listInfo,"access software. Together with the information stored on the ",AFTER); ListAddString(listInfo,"associated CDROM, this program allows anyone to access, search, ",AFTER); ListAddString(listInfo,"view, and print data sheets, application notes, and other publications ",AFTER); ListAddString(listInfo, "covering LTC products.", AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "LinearView and Adobe Acrobat installations are required to view the", AFTER); ListAddString(listInfo, "documents stored on the CDROM.", AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "Four additional design aids are included on the CDROM: Switcher-", AFTER); ListAddString(listInfo, "CAD, FilterCAD, Spice, and Noise. These programs can be started", AFTER); ListAddString(listInfo, "from within LinearView if installed along with LinearView (or if ", AFTER); ListAddString(listInfo, "LINEAR.INI is updated with a path if the design aids are installed", AFTER); ListAddString(listInfo, "at a later time).", AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "The programs will not successfully operate from the CDROM and", AFTER); ListAddString(listInfo, "must be installed onto a hard drive for proper operation.", AFTER); nResult = SdShowInfoList(szTitle, "", listInfo); if (nResult = 12) then goto WelcomeDlg; endif; if (nResult = NEXT) then Disable(DIALOGCACHE); Enable(DIALOGCACHE); MessageBox("Please take a moment to read the following screens carefully.\nWe know it's a pain, but a little time spent now will result in a satisfactory installation.", INFORMATION); endif; ExtrasDlg: listInfo = ListCreate(STRINGLIST); szTitle = "LinearView Installation"; ListAddString(listInfo,"SwitcherCAD",AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "SwitcherCAD is a powerful aid for designing DC-DC converters", AFTER); ListAddString(listInfo, "that incorporate Linear Technology Corporation's switching", AFTER); ListAddString(listInfo, "regulator ICs. Its use saves time by eliminating searches", AFTER); ListAddString(listInfo, "through multiple datasheets, application notes, and magazine", AFTER); ListAddString(listInfo, "articles for possible design solutions.", AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "The program requires the user to enter values for a small", AFTER); ListAddString(listInfo, "set of basic parameters. Based on these inputs, SwitcherCAD", AFTER); ListAddString(listInfo, "selects one or more LTC ICs and circuit topologies that", AFTER); ListAddString(listInfo, "satisfy the design. The program also selects the necessary", AFTER); ListAddString(listInfo, "external components such as input and output capacitors,", AFTER); ListAddString(listInfo, "diodes, and inductors. The design results, parts list,", AFTER); ListAddString(listInfo, "and schematic can be printed.", AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "FilterCAD", AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "FilterCAD is a computer-aided design program that eases the", AFTER); ListAddString(listInfo, "design of circuits using Linear Technology Corporation's", AFTER); ListAddString(listInfo, "switched-capacitor filter IC family. FilterCAD supports the", AFTER); ListAddString(listInfo, "LTC1059, 1059A, 1060, 1060A, 1061, 1064, 1064A, and 1164.", AFTER); ListAddString(listInfo, "This program requires minimal effort, making it easy for", AFTER); ListAddString(listInfo, "everyone to design filters. Experienced filter designers ", AFTER); ListAddString(listInfo, "can interactively alter component values, observe a circuit's", AFTER); ListAddString(listInfo, "performance, and fine tune for best results.", AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "FilterCAD handles any of the four major filter transfer functions", AFTER); ListAddString(listInfo, "(low-pass, bandpass, notch, and high-pass) that use Butterworth,", AFTER); ListAddString(listInfo, "Chebyshev, Elliptic, or custom-designed response character-", AFTER); ListAddString(listInfo, "istics. FilterCAD's designs are based on cascading state-", AFTER); ListAddString(listInfo, "variable second-order sections. The program generates plots", AFTER); ListAddString(listInfo, "of amplitude, phase, and group-delay, selects appropriate ", AFTER); ListAddString(listInfo, "devices and mode, and calculates resistor values. The design", AFTER); ListAddString(listInfo, "results, parts list, and schematic can be printed.", AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "Spice Macromodel", AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "Spice Macromodel contains an LTC op amp SPICE macromodel", AFTER); ListAddString(listInfo, "library that can be used with any version of SPICE or the", AFTER); ListAddString(listInfo, "demonstration version of PSpice[TM] (from MicroSim) included", AFTER); ListAddString(listInfo, "with this library. This library allows users to simulate general", AFTER); ListAddString(listInfo, "analog circuits.", AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "Noise", AFTER); ListAddString(listInfo, "", AFTER); ListAddString(listInfo, "Noise is a program that calculates noise of circuits using LTC", AFTER); ListAddString(listInfo, "operational amplifiers. The program can select the best op amp ", AFTER); ListAddString(listInfo, "for low noise applications, displays op amp noise data, calculates", AFTER); ListAddString(listInfo, "resistor noise, and calculate noise using specifications for any", AFTER); ListAddString(listInfo, "op amp.", AFTER); if (SdShowInfoList(szTitle, "", listInfo) = 12) then goto IntroDlg; endif; Disable(DIALOGCACHE); Enable(DIALOGCACHE); // Test target system for proper configuration. if(GetSystemInfo(OS,nvResult,svResult) < 0) then MessageBox("Couldn't get Operating System information!", WARNING); else switch(nvResult) case IS_WINDOWS: sOS = "Windows"; case IS_WINDOWSNT: sOS = "Windows NT"; case IS_WINDOWS95: sOS = "Windows 95"; case IS_WIN32S: sOS = "Win32s"; endswitch; endif; if(GetSystemInfo(WINMAJOR,nvResult,svResult) < 0) then MessageBox("Couldn't get Windows major version information!", WARNING); else sWinMajor = svResult; nWinMajor = nvResult; endif; if(GetSystemInfo(WINMINOR,nvResult,svResult) < 0) then MessageBox("Couldn't get Windows minor version information!", WARNING); else sWinMinor = svResult; nWinMinor = nvResult; endif; if(GetSystemInfo(OSMAJOR,nvResult,svResult) < 0) then MessageBox("Couldn't get Operating System major version information!", WARNING); else nOSMajor = nvResult; endif; if(GetSystemInfo(OSMINOR,nvResult,svResult) < 0) then MessageBox("Couldn't get Operating System minor version information!", WARNING); else nOSMinor = nvResult; endif; /* for DEBUG szMsg = "Operating system is %s, version %s\n" + "Windows Major version: %d\n" + "Windows Minor version: %d\nOperating System Major version: %d\n" + "Operating System Minor version: %d"; SprintfBox(INFORMATION, "Debugging",szMsg,sOS, sWinMajor, nWinMajor, nWinMinor, nOSMajor, nOSMinor); */ // Section below replaces use of WinMinor, which appears to be buggy // If Windows 3.1x, test for vshare, and, if not present, offer to add. if(sOS = "Windows") then if(FindFile(WINSYSDIR,"vshare.386",svDummyResult)<0) then szMsg = "Setup has detected that you are running Windows and that you do not\n" + "have VSHARE loaded with Windows. VSHARE may be required to view the images\n" + "within the LinearView application. Would you like to have Setup\n" + "add VSHARE to your system?"; SetDialogTitle(DLG_ASK_YESNO, "Install VSHARE?"); if(AskYesNo(szMsg, YES) = YES) then VarSave(SRCTARGETDIR); TARGETDIR = WINSYSDIR; SRCDIR = SRCDIR ^ APPBASE_PATH; // SHOULD BE CHANGED TO ALLOW RUNNING FROM ARBITRARY ROOT CopyFile("VSHARE.386","VSHARE.386"); VarRestore(SRCTARGETDIR); szPath = WINDIR ^ "SYSTEM.INI"; AddProfString(szPath ,"386Enh","device","vshare.386"); endif; endif; endif; // Ask user for a destination location for the installation. GetOptions: szTitle = "LinearView Installation Options"; svTarget = TARGETDISK ^ APPBASE_PATH; szMsg = "Install the following components:"; szComponents = "LinearView"; ComponentAddItem(szComponents, "LinearView Program (Required)", 5000000, TRUE); ComponentAddItem(szComponents, "Acrobat Exchange (Required)", 7000000, TRUE); ComponentAddItem(szComponents, "SwitcherCAD (Optional)", 966000, FALSE); ComponentAddItem(szComponents, "FilterCAD (Optional)", 332000, FALSE); ComponentAddItem(szComponents, "Spice (Optional)", 1000000, FALSE); ComponentAddItem(szComponents, "Noise (Optional)", 71000, FALSE); if ( SdComponentDialogAdv( szTitle, szMsg, svTarget, szComponents ) = 12 ) then goto ExtrasDlg; endif; ComputeSpace: bLinear = FALSE; bAcrobat = FALSE; bSwitcher = FALSE; bFilter = FALSE; bSpice = FALSE; bNoise = FALSE; listSpace = ListCreate(STRINGLIST); nSpaceRequired = 0; ComponentListItems(szComponents, listSpace); nResult = ListGetFirstString(listSpace, svComponent); nFileCount = 0; while(nResult = 0) ComponentGetItemSize(szComponents, svComponent, nvSize); if(ComponentIsItemSelected(szComponents, svComponent)) then nSpaceRequired = nSpaceRequired + nvSize; if(svComponent = "LinearView Program (Required)") then bLinear = TRUE; nFileCount = nFileCount + 8; endif; if(svComponent = "Acrobat Exchange (Required)") then bAcrobat = TRUE; endif; if(svComponent = "SwitcherCAD (Optional)") then bSwitcher = TRUE; nFileCount = nFileCount + 16; endif; if(svComponent = "FilterCAD (Optional)") then bFilter = TRUE; nFileCount = nFileCount + 18; endif; if(svComponent = "Spice (Optional)") then bSpice = TRUE; endif; if(svComponent = "Noise (Optional)") then bNoise = TRUE; nFileCount = nFileCount + 1; endif; endif; nResult = ListGetNextString(listSpace, svComponent); endwhile; // Perform space check of target drive. bSpaceOk = TRUE; if (GetDiskSpace( svTarget ) < nSpaceRequired) then szMsg = "There is not enough space available on the disk\n" + "'" + svTarget + "' \n" + "Please free up some space or change the target location\n" + "to a different disk"; MessageBox( szMsg, WARNING ); bSpaceOk = FALSE; endif; // If not enough space, ask user to try again. if (bSpaceOk = FALSE) then goto GetOptions; endif; SetupFilesToTransfer: SRCDIR = SRCDISK; //CALCULATE STATUS BAR PERCENTAGES nSize = 1; // allow for other tasks at end to calculate percentages if(bLinear = TRUE) then nSize = nSize + 40; endif; if(bAcrobat = TRUE) then nSize = nSize + 70; endif; if(bSpice = TRUE) then nSize = nSize + 15; endif; if(bNoise = TRUE) then nSize = nSize + 1; endif; if(bSwitcher = TRUE) then nSize = nSize + 10; endif; if(bFilter = TRUE) then nSize = nSize + 3; endif; TARGETDIR = svTarget; DeinstallStart(svTarget, svUninstLogFile, DEINSTALL_KEY, 0); RegDBSetItem(REGDB_UNINSTALL_NAME, UNINSTALL_NAME); StrSub(szDrive,svTarget,0,2); TARGETDISK = szDrive; SelectFldr: svFolder = PROGRAM_FOLDER_NAME; //Default folder name szTitle = "Select Program Folder"; szMsg = "Setup will add the LinearView items to the folder " + "in the Program Folders field.\n You can type a new " + "folder name or select one from the list of existing " + "folders."; SdSelectFolder(szTitle, szMsg, svFolder); if(QueryProgGroup(svFolder, svGroupPath, nvItemCount) < 0) then SetDialogTitle(DLG_ASK_YESNO, "Create Folder?"); if(AskYesNo("This folder does not exist. " + "Should Setup create it?", YES) = YES) then CreateProgGroupEx(svFolder,""); else goto SelectFldr; endif; endif; Disable( DIALOGCACHE ); Enable(INDVFILESTATUS); Enable(STATUS); if(bAcrobat = TRUE) then StatusUpdate( ON, 25 ); else StatusUpdate( ON, 35 ); endif; SetStatusWindow(0, "Copying LinearView program files..."); if(bLinear = TRUE) then VarSave(SRCTARGETDIR); SRCDIR = SRCDIR ^ APPBASE_PATH; // SHOULD BE CHANGED TO ALLOW RUNNING FROM ARBITRARY ROOT CopyFile("ADL.DLL","ADL.DLL"); CopyFile("ADL_MSGS.ENG","ADL_MSGS.ENG"); CopyFile("LINEAR.EXE","LINEAR.EXE"); CopyFile("MFC250.DLL","MFC250.DLL"); CopyFile("TABDLL11.DLL","TABDLL11.DLL"); CopyFile("CPDFVIEW.DLL","CPDFVIEW.DLL"); CopyFile("README.TXT","README.TXT"); CopyFile("LINEAR.HLP","LINEAR.HLP"); CopyFile("GX1116R.DLL","GX1116R.DLL"); CopyFile("MFCOLEUI.DLL","MFCOLEUI.DLL"); VarRestore(SRCTARGETDIR); nDone = nDone + 40; endif; if(bSwitcher = TRUE) then SetStatusWindow(nDone/nSize, "Copying SwitcherCAD files..."); VarSave(SRCTARGETDIR); SRCDIR = SRCDIR ^ "SWCAD"; TARGETDIR = TARGETDIR ^ "SWCAD"; XCopyFile("*.*","*.*",INCLUDE_SUBDIR); VarRestore(SRCTARGETDIR); nDone = nDone + 10; endif; if(bFilter = TRUE) then SetStatusWindow(nDone/nSize, "Copying FilterCAD files..."); VarSave(SRCTARGETDIR); SRCDIR = SRCDIR ^ "FCAD"; TARGETDIR = TARGETDIR ^ "FCAD"; XCopyFile("*.*","*.*",INCLUDE_SUBDIR); VarRestore(SRCTARGETDIR); nDone = nDone + 3; endif; if(bNoise = TRUE) then SetStatusWindow(nDone/nSize, "Copying Noise files..."); VarSave(SRCTARGETDIR); SRCDIR = SRCDIR ^ "NOISE"; TARGETDIR = TARGETDIR ^ "NOISE"; XCopyFile("*.*","*.*",INCLUDE_SUBDIR); VarRestore(SRCTARGETDIR); nDone = nDone + 1; endif; if(bSpice = TRUE) then SetStatusWindow(nDone/nSize, "Copying Spice files..."); VarSave(SRCTARGETDIR); SRCDIR = SRCDIR ^ "SPICE"; TARGETDIR = TARGETDISK ^ "SPICE"; XCopyFile("*.*","*.*",INCLUDE_SUBDIR); VarRestore(SRCTARGETDIR); nDone = nDone + 15; endif; SetStatusWindow(nDone/nSize, "Updating system..."); if((sOS = "Windows") || (sOS = "Windows 95")) then /* for DEBUG MessageBox("DEBUG: - Reached IF Windows!", INFORMATION); */ VarSave(SRCTARGETDIR); TARGETDIR = WINSYSDIR; SRCDIR = SRCDIR ^ APPBASE_PATH; // SHOULD BE CHANGED TO ALLOW RUNNING FROM ARBITRARY ROOT CopyFile("LINEAR.FON","LINEAR.FON"); VarRestore(SRCTARGETDIR); szPath = WINDIR ^ "WIN.INI"; WriteProfString(szPath,"fonts","Linear","LINEAR.FON"); WriteProfString("","","",""); // If moved to Win95, this flushes buffer Disable(LOGGING); Ole2Dll(); Enable(LOGGING); endif; CreateIniFile: if(bLinear = TRUE) then szIniFile = svTarget ^ "LINEAR.INI"; szMsg = "Unable to write to INI file."; if (CreateFile(nvFileHandle, svTarget, "LINEAR.INI") = 0) then WriteLine(nvFileHandle, "[Main]"); WriteLine(nvFileHandle, "Window=1"); WriteLine(nvFileHandle, "Width=640"); WriteLine(nvFileHandle, "Height=480"); WriteLine(nvFileHandle, ""); WriteLine(nvFileHandle, "[Paths]"); szLine = "PFT=" + SRCDISK ^ "DSR"; WriteLine(nvFileHandle, szLine); szLine = "TOC=" + SRCDISK ^ "DSR"; WriteLine(nvFileHandle, szLine); szLine = "ADL=" + SRCDISK ^ "DATABASE"; WriteLine(nvFileHandle, szLine); szLine = "PDF=" + SRCDISK; WriteLine(nvFileHandle, szLine); szLine = "Sales=" + SRCDISK ^ "LINEAR\\SALES.PDF"; WriteLine(nvFileHandle, szLine); szLine = "Tree=" + SRCDISK ^ "DSR\\TREE.DSR"; WriteLine(nvFileHandle, szLine); WriteLine(nvFileHandle, ""); WriteLine(nvFileHandle, "[Launch]"); szLine = "PNMovie=" + SRCDISK ^ "LINEAR\\PARTNO.EXE"; WriteLine(nvFileHandle, szLine); szLine = "KWMovie=" + SRCDISK ^ "LINEAR\\KEYWORD.EXE"; WriteLine(nvFileHandle, szLine); szLine = "OAMovie=" + SRCDISK ^ "LINEAR\\OPAMP.EXE"; WriteLine(nvFileHandle, szLine); if (bNoise = TRUE) then szLine = "Noise=" + TARGETDIR ^ "NOISE\\NOISE.EXE"; WriteLine(nvFileHandle, szLine); endif; if (bSwitcher = TRUE) then szLine = "Switcher=" + TARGETDIR ^ "SWCAD\\SCAD.EXE"; WriteLine(nvFileHandle, szLine); endif; if (bFilter = TRUE) then szLine = "Filter=" + TARGETDIR ^ "\FCAD\\FCAD.EXE"; WriteLine(nvFileHandle, szLine); endif; if (bSpice = TRUE) then szLine = "Spice=" + TARGETDISK ^ "SPICE\\PSPICE1.EXE"; WriteLine(nvFileHandle, szLine); endif; else szMsg = "Unable to create " + szIniFile; MessageBox(szMsg, WARNING); endif; endif; // Create program folders and icons. InstallProgramItems: SetStatusWindow( 95, "Creating Program Group and Icons...." ); Delay(1); AppCommand( PROGMAN, CMD_RESTORE ); szProgram = svTarget ^ "LINEAR.EXE"; ShowProgramFolder( svFolder, SW_SHOW ); AddFolderIcon( svFolder, APP_NAME, szProgram, svTarget, "", 0, "", REPLACE ); Delay( 1 ); /* AddFolderIcon( svFolder, "LinearView Help", "WINHELP.EXE" + " " + svTarget ^ "LINEAR.HLP", svTarget, "", 0, "", REPLACE ); Delay( 1 ); */ /* AddFolderIcon( svFolder, "Readme ", "NOTEPAD.EXE " + svTarget ^ "README.TXT", svTarget, "", 0, "", REPLACE ); Delay( 1 ); */ // UNINST global variable stores the file name (with full path) of // the uninstaller file. szProgram = UNINST; szProgram = szProgram + " -f" + svUninstLogFile; AddFolderIcon( svFolder, "unInstallSHIELD", szProgram, WINDIR, "", 0, "", REPLACE ); Delay( 1 ); // Announce setup complete and offer to read README file. FinalInstallProcess: szMsg = "Main Installation complete."; SetStatusWindow( 100, szMsg ); Delay(2); Disable(STATUS); /* This stuff implements the old batch file method. May have a drive letter bug. if(bSpice = TRUE) then szMsg = "SPICE installation will now commence."; MessageBox(szMsg, INFORMATION); endif; if (bSpice = TRUE) then LaunchAppAndWait( SRCDISK ^ "SPICE\\XCPY2DSC.BAT", SRCDISK ^ "SPICE " + TARGETDISK ^ "SPICE", NOWAIT ); Delay(2); endif; */ if(bAcrobat = FALSE) then szMsg = "Setup is complete. You may run the installed program "+ "by double-clicking on the program icon installed."; else szMsg = "The Adobe Acrobat Setup Program will now be launched..."; endif; MessageBox( szMsg, INFORMATION ); if(bAcrobat = TRUE) then szPath = SRCDISK ^ "acroexch\\disk1\\acroinst.exe"; nvResult = LaunchApp(szPath,""); if (nvResult != 0) then MessageBox("Acrobat Installation is unable to start.",WARNING); endif; endif; exit; /*---------------------------------------------------------------------------*\ * * Function: SetupScreen * * Purpose: This function will set up the screen look. This includes * colors, fonts, text to be displayed, etc. * * * Input: * * Returns: * * Comments: \*---------------------------------------------------------------------------*/ function SetupScreen() number nDx, nDy; begin GetExtents( nDx, nDy ); Enable( FULLWINDOWMODE ); Enable( INDVFILESTATUS ); Enable( BITMAP256COLORS ); Enable( DIALOGCACHE ); SetTitle( "Installing " + APP_NAME, 24, WHITE ); SetColor( BACKGROUND, BK_BLUE ); // Dark blue. SetColor( STATUSBAR, BLUE ); // Bright blue. SetTitle( "Setup", 0, BACKGROUNDCAPTION ); // Caption bar text. Enable( BACKGROUND ); Delay( 1 ); end; /*---------------------------------------------------------------------------*\ * * Function: CheckRequirements * * Purpose: This function will check all minimum requirements for the * application being installed. If any fail, then the user * is informed and the installation is terminated. * * * Input: * * Returns: * * Comments: \*---------------------------------------------------------------------------*/ function CheckRequirements() number nvDx, nvDy; number nvVersion; STRING szResult; begin // Check screen resolution. GetExtents( nvDx, nvDy ); if (nvDy < 480) then MessageBox( "This program requires VGA or better resolution.", WARNING ); exit; endif; end; /*------------------------------------------------------------------------ Name : Ole2Dll() Purpose : This function is used to check to make sure the OLE2 Registration and DLL files are current... --------------------------------------------------------------------------*/ function Ole2Dll() begin /*********************************************************************** Will Run the OLE2 Checking and registration Program!!!!! **********************************************************************/ VarSave(SRCTARGETDIR); SRCDIR = SRCDISK ^ "OLE2"; TARGETDIR = WINSYSDIR; szOLE = "COMPOBJ.DLL"; lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile); szOLE = "OLE2.DLL"; lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile); szOLE = "OLE2PROX.DLL"; lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile); szOLE = "OLE2DISP.DLL"; lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile); szOLE = "OLE2NLS.DLL"; lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile); szOLE = "OLE2CONV.DLL"; lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile); szOLE = "OLE2CONV.DLL"; lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile); szOLE = "STORAGE.DLL"; lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile); szOLE = "TYPELIB.DLL"; lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile); szOLE = "CTL3DV2.DLL"; lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile); if((FileCompare("Ole2.Reg", "Ole2.Reg", COMPARE_SIZE) = GREATER_THAN) || (FileCompare("Ole2.Reg", "Ole2.Reg", COMPARE_DATE) = GREATER_THAN || FILE_NOT_FOUND)) then CopyFile("Ole2.Reg", "Ole2.Reg"); endif; if((FileCompare("Stdole.TLB", "Stdole.TLB", COMPARE_SIZE) = GREATER_THAN) || (FileCompare("Stdole.TLB", "Stdole.TLB", COMPARE_DATE) = GREATER_THAN || FILE_NOT_FOUND)) then CopyFile("Stdole.TLB", "Stdole.TLB"); endif; /*************** Run Regedit automatically...If didn't copy new OLE2.REG, makes sure the registry is corect. *****/ LaunchApp( WINDIR ^ "regedit", " /s ole2.reg"); VarRestore(SRCTARGETDIR); end; /****************************** ******************************/ #include "sddialog.rul"